#ifndef __BOX_HPP__
#define __BOX_HPP__

#include <container.hpp>

namespace gtkhpp {

class Box : public Container {
public:
	enum ORIENTATION {
		HORIZONTAL,
		VERTICAL
	};
	Box(const ORIENTATION &orientation=HORIZONTAL, const bool &homogeneous = true, const int &spacing=0);
	void set_homogeneous(bool homogeneous);
};

inline Box::Box(const ORIENTATION &orientation, const bool &homogeneous, const int &spacing)
	: Container(NULL)
{
#if (GTK_MAJOR_VERSION < 3) || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 2)
	if (orientation == HORIZONTAL) {
		obj = G_OBJECT(gtk_hbox_new(homogeneous, spacing));
	} else {
		obj = G_OBJECT(gtk_vbox_new(homogeneous, spacing));
	}
#else
	obj = G_OBJECT(gtk_box_new(orientation, spacing));
	set_homogeneous(homogeneous);
#endif
}

inline void Box::set_homogeneous(bool homogeneous)
{
	gtk_box_set_homogeneous(GTK_BOX(obj), (gboolean)homogeneous);
}

} // namespace gtkhpp

#endif /* end of include guard */
